<?php
/**
 * The application configuration file.
 * @package KvScheduler
 * @subpackage Config
 * @author Greg McWhirter <gsmcwhirter@gmail.com>
 * @copyright Copyright &copy; 2008, Greg McWhirter
 * @version $Revision$
 */

#load_files(
#  KVF_INCLUDES."/lib/mailer.class.php",
#  KVF_INCLUDES."/lib/functions.lib.php"
#);

/**
 * Essentially an ENUM of access level bit numbers
 *
 * @package KvScheduler
 */
abstract class ACCESS{
  /**
   * Sysop level
   *
   */
  const sysop = 5;
  /**
   * Supervisor level
   *
   */
  const modify = 4;
  /**
   * Helpdesk level
   *
   */
  const user = 3;
  /**
   * Consultant level
   *
   */
  const display = 2;
  /**
   * ACD Flag
   */
  const acd = 1;
  /**
   * Staff Flag
   */
  const staff = 6;

  const noauth = 0;
}

/**
 * Application settings class
 *
 * @package KvScheduler
 * @subpackage Config
 *
 */
abstract class SETTINGS
{

  const LDAP_SERVER = null; //string name of ldap server or null to disable
  const LDAP_BASEDN = "o=My Organization, c=US";
  const LDAP_SEARCHSTR = "mail=?@*";
  const EMAIL_REGEXP = '^[a-zA-Z0-9_\-\.+]+[@+]{1}[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$';
  public static $CHARDUMP = 'abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
  /**
   * SQL snippet
   *
   */
  const SQL_REALNAME_ORDER_CLAUSE = "SUBSTRING(users.user_realname FROM (INSTR(users.user_realname, ' ')+1)) ASC, users.user_realname";

  public static $APPT_NAMES = array(
    "normal" => "Regular Appointments",
    "wireless" => "Wireless Appointments",
    "limited" => "Limited Appointments",
    "other" => "Other Appointments"
  );

  //Setting key length <= 20!!
  /**
   * Holds defaults for system setting variables
   *
   * @var array
   */
  public static $VARS = array(
    "travel_tolerance" => array("Travel Tolerance", 3, 1, 'integer', 'input'),
    "send_email" => array("Send Emails", true, 3, 'boolean', 'select'),
    "email_admin" => array("Admin Address", "admin@mydomain.com", 4, 'string', 'input'),
    "email_from" => array("From Address", "fromaddr@mydomain.com", 5, 'string', 'input'),
    "backup_dir" => array("Backup Directory", "/path/to/backup/dir", 7, 'string', 'input'),
    "acd_on" => array("Use Temp Accounts", false, 8, 'boolean', 'select'),
    "finals_flag" => array("No Same Day Scheduling", false, 21, 'boolean', 'select'),
    "at_generic" => array("regular", 1, 9, 'integer', 'select', "appttype"),
    "at_limited" => array("limited", 2, 10, 'integer', 'select', "appttype"),
    "at_wireless" => array("wireless", 3, 11, 'integer', 'select', "appttype"),
    "at_other" => array("other", 4, 12, 'integer', 'select', "appttype"),
    "week_start" => array("Weeks Start On", "N", 17, 'string', 'select', array("Sunday","Monday", "Tuesday", "Wednesday", "Thursday", "Friday","Saturday")),
    "appt_buffer" => array("Buffer Time (hours)", 2, 18, 'integer', 'input'),
    "appt_sched" => array("Appointment Scheduling", 2047, 19, 'bitmask', 'checkbox'),
    "sem_default" => array("Current Semester", null, 2, 'integer','select', "Semester"),
    "loc_time_buff" => array("Location Time Buffer", 4.0, 20, 'float', 'input')
  );

  /**
   * Holds defaults for more system setting varaibles
   *
   * @var array
   */
  static $VARS_OVERRIDES = array(
    "override_randomlist" => array("Randomize Consultants (below)", ACCESS::modify, 1, 'integer'),
    "override_concur" => array("Concurrent Appts.", ACCESS::modify, 2, 'integer'),
    "override_far" => array("Appointment Distance.", ACCESS::modify, 3, 'integer'),
    "override_gender" => array("Location Gender", ACCESS::modify, 4, 'integer'),
    "override_length" => array("Appointment Length", ACCESS::modify, 5, 'integer'),
    "override_time" => array("Time of Scheduling", ACCESS::modify, 6, 'integer'),
    "override_finals" => array("Finals Week", ACCESS::modify, 7, 'integer'),
    "override_appthour" => array("Apppointment Hours", ACCESS::modify, 8, 'integer'),
  );

  /**
   * Default readable date format
   */
  const DATE_STRING = "D, M. jS g:i A";
}
?>
